<?php

include_once 'zingme-sdk/BaseZingMe.php';
include_once 'zingme-sdk/ZME_Me.php';
include_once 'zingme-sdk/ZME_User.php';
include_once 'zingme-sdk/ZME_FeedDialog.php';



$config_dev = array(
	'appname' => 'haohung',
	'apikey' => '569637a702974dca85b98e3e2553bfcc',
	'secretkey' => 'c53050cccbe3450fbaadcb3baa019249',
	'env' => 'development'
);

$config = $config_dev;
$zm_Me = new ZME_Me($config);

$signed_request = $_POST['Code'];
$access_token = $zm_Me->getAccessTokenFromSignedRequest($signed_request);

$me = $zm_Me->getInfo($access_token);
echo $me["username"];
?>